<?php

namespace App\Modules\Common;

use App\Modules\Good\Models\Good;
use App\Modules\Package\Models\GoodPackage;
use App\Modules\Shop\Shop;
use Illuminate\Console\Scheduling\Schedule as BaseSchedule;

class Schedule
{
    public static function invoke(BaseSchedule $schedule)
    {
        $schedule->call([self::class, 'refreshRank'])->everyTenMinutes()->name('刷新职员排行');
    }

    public static function refreshRank()
    {
        JewelryRank::refresh();
        MoneyRank::refresh();
        PhotoRank::refresh();
        RebateRank::refresh();
        NumberRank::refresh();

        PartnerJewelryRank::refresh();
        PartnerMoneyRank::refresh();
        PartnerPhotoRank::refresh();
        PartnerRebateRank::refresh();
        PartnerNumberRank::refresh();

        LowerSalesRank::refresh();
        LowerRebateRank::refresh();
    }
}
